package com.whfc.fuum.dto;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * @Description:
 * @author: xugcheng
 * @version: 1.0
 * @date: 2019/7/22 20:46
 */
@Data
public class SysDeptDTO implements Serializable {

    /**
     * 主键
     */
    private Integer id;

    /**
     * GUID
     */
    private String guid;

    /**
     * 父节点ID
     */
    private Integer pid;

    /**
     * 父节点路径
     */
    private String pids;

    /**
     * 机构名称
     */
    private String name;

    /**
     * 详细信息
     */
    private String detail;

    /**
     * 机构类型
     */
    private Integer type;

    /**
     * 机构状态
     */
    private Integer state;

    /**
     * 组织机构索引位置
     */
    private Integer index;

    /**
     * 是否授权
     */
    private Boolean authorized;

    /**
     * 标题
     */
    private String title;

    public SysDeptDTO() {
    }

    public SysDeptDTO(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    private List<SysDeptDTO> children;

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        SysDeptDTO other = (SysDeptDTO) obj;
        if (id == null) {
            if (other.id != null) {
                return false;
            }
        } else if (!id.equals(other.id)) {
            return false;
        }
        return true;
    }


}
